import instance from '@/http/index.js'

//文件绑定账号
export const fileBindAccount = (apply_id, onlyId) => {
    return instance.post('/apply/fileBindAccount', { apply_id, onlyId })
}

//申请助学金
export const applyBursary = (data) => {
    return instance.post('/apply/applyBursary', data)
}

//小组审核接口
export const groupAudit = (data) => {
    const { id, status, audit_person_a, audit_opinion_a,type } = data
    return instance.post('/apply/groupAudit', { id, status, audit_person_a, audit_opinion_a,type })
}

//查看个人助学金申请列表接口
export const getBursaryApplications = (student_id,page) => {
    return instance.post('/apply/getBursaryApplications', { student_id,page })
}


//更新助学金申请信息接口
export const updateBursaryApplication = (data) => {
    const { id,family_income,bursary_level, reason } = data;
    return instance.post('/apply/updateBursaryApplication', { id,family_income,bursary_level, reason })
}

//监听分页查询助学金申请列表
export const getBursaryByPage = (page) => {
    return instance.post('/apply/getBursaryByPage', { page })
}

//辅导员审核
export const counselorAudit = (data) => {
    const { id, status, audit_person_b, audit_opinion_b,type } = data;
    return instance.post('/apply/counselorAudit', { id, status, audit_person_b, audit_opinion_b,type })
}
//院领导审核
export const deanAudit = (data) => {
    const { id, status, audit_person_c, audit_opinion_c,type } = data;
    return instance.post('/apply/deanAudit', { id, status, audit_person_c, audit_opinion_c,type })
}

//根据编号获取助学金申请表详情接口
export const getBursaryById = (id) => {
    return instance.post('/apply/getBursaryById', { id})
}
//查询助学金申请信息返回文件链接
export const getBursaryFileUrl = (apply_id) => {
    return instance.post('/apply/getBursaryFileUrl', { apply_id })
}

//申请奖学金
export const applyScholarship = (data) => {
    return instance.post('/apply/applyScholarship', data)
}

//监听分页查询奖学金申请列表
export const getScholarshipByPage = (page) => {
    return instance.post('/apply/getScholarshipByPage', { page }) 
}
//根据编号获取奖学金申请表详情接口
export const getScholarById = (id) => {
    return instance.post('/apply/getScholarById', { id})
}

//查看个人奖学金申请列表接口
export const getScholarshipApplications = (student_id,page) => {
    return instance.post('/apply/getScholarshipApplications', { student_id,page })
}

// 更新奖学金申请信息接口
export const updateScholarshipApplication = (data) => {
    const { id,scholarship_level, reason } = data;
    return instance.post('/apply/updateScholarshipApplication', { id,scholarship_level, reason })
}

//删除指定的助学金申请
export const deleteBursaryApplication = (id) => {
    return instance.post('/apply/deleteBursaryApplication', { id })
}

//删除指定的奖学金申请
export const deleteScholarshipApplication = (id) => {
    return instance.post('/apply/deleteScholarshipApplication', { id }) 
}

// 生成验证码并发送
export const sendVerificationCode = (mobile) => {
    return instance.post('/apply/sendVerificationCode', { mobile }) 
}